/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bff.slimserver.musicjukebox.ui.components;

import com.bff.bjj.ui.component.ColorProperties;
import com.bff.bjj.utils.Resources;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JDialog;

/**
 *
 * @author Bill
 */
public class MusicJDialog extends JDialog {    
    
    public MusicJDialog(java.awt.Frame parent) {
        this(parent, true);
        setColors();
    }

    public MusicJDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        setColors();
    }

    protected void setHalfScreenSizeCentered() {
        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension d = tk.getScreenSize();
        int heightScreen = d.height / 2;
        int widthScreen = d.width / 2;
        setLocation(widthScreen - (int) (getWidth() / 2), heightScreen - (int) (getHeight() / 2));
    }

    protected void setPanelColors() {
        setColors();
    }

    private void setColors() {
        setBackground(ColorProperties.PANEL_BACKGROUND);
    }

    protected String getResource(Resources.LABEL_KEY key) {
        return Resources.getMessage(key);
    }

    protected String getResource(Resources.LABEL_KEY key, Object[] params) {
        return Resources.getMessage(key, params);
    }
}
